Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Response Status Code Checks to IntegrationTestUtils #3025

Merged

Conversation

adrianhoelzl-sap
Copy link
Contributor

closes #2889

…eStatusCode (now "createGroupAndIgnoreConflict"): now only allows 200 OK or 409 CONFLICT
@adrianhoelzl-sap adrianhoelzl-sap marked this pull request as ready for review September 4, 2024 07:30
@adrianhoelzl-sap adrianhoelzl-sap requested a review from a team September 4, 2024 07:31
@peterhaochen47
Copy link
Member

peterhaochen47 commented Sep 4, 2024

@adrianhoelzl-sap Makes sense overall, thanks!
I tried and saw that for lines like this one:

IntegrationTestUtils.createGroupAndIgnoreConflict(token, "", baseUrl, group);

If you narrow it to just IntegrationTestUtils.createGroup (aka do not ignore conflicts but still expect HttpStatus.CREATED), the tests will still be passing. Why ignore? Maybe we should use the more strict check (expect HttpStatus.CREATED only)?

@adrianhoelzl-sap
Copy link
Contributor Author

@adrianhoelzl-sap Makes sense overall, thanks! I tried and saw that for lines like this one:

IntegrationTestUtils.createGroupAndIgnoreConflict(token, "", baseUrl, group);

If you narrow it to just IntegrationTestUtils.createGroup (aka do not ignore conflicts but still expect HttpStatus.CREATED), the tests will still be passing. Why ignore? Maybe we should use the more strict check (expect HttpStatus.CREATED only)?

For me, the tests fail because the groups already exist, maybe they are created already by previous tests. You can see the error messages in the voters for commit c51ed9f.
IMO, it is fine to accept the conflict status code here, since we just want to ensure that the groups are present. If they already are, we can ignore the error.

@adrianhoelzl-sap
Copy link
Contributor Author

@adrianhoelzl-sap Makes sense overall, thanks! I tried and saw that for lines like this one:

IntegrationTestUtils.createGroupAndIgnoreConflict(token, "", baseUrl, group);

If you narrow it to just IntegrationTestUtils.createGroup (aka do not ignore conflicts but still expect HttpStatus.CREATED), the tests will still be passing. Why ignore? Maybe we should use the more strict check (expect HttpStatus.CREATED only)?

@peterhaochen47 I made the behavior of the createGroup calls in SamlLoginIT more explicit by adding a method ensureGroupExists and removing the createGroupAndIgnoreConflict method (commit 7fc64b2).

@adrianhoelzl-sap adrianhoelzl-sap merged commit c441c35 into develop Sep 9, 2024
22 checks passed
@adrianhoelzl-sap adrianhoelzl-sap deleted the add-response-status-checks-to-integrationtestutils branch September 9, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Missing Response Status Checks in IntegrationTestUtils
2 participants